<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>JavaScript Geo API</title>
<!-- 記得要引入這支js檔。 -->
<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script> 
</head> 
<body> 
<script type="text/javascript"> 
	var countryName = ""; 
	try 
	{ 
		if(geoip_country_name() != "" && geoip_country_name() != null) 
		countryName += geoip_country_name(); 

		////如果抓中國來的訪客，去判斷國家名稱(countryName)是否為'China'，C記得要大寫！
		console.log('Success');
		console.log(countryName);
	} 
	catch(err) 
	{ 
		countryName="";
		
		console.log('Error!!');
		console.log(countryName);
	} 
</script> 
</body> 
</html> 